package com.mingqijia.gassafety.shared.constant;

/**
 * 报警类型
 * @author solyutian
 * @date 2023/6/27 09:59
 */
public enum ConsoleSkAlarmTypeEnum {
  SOS(1,"SOS"),
  SMOKE(2,"烟雾报警"),
  SMOKE_REMOVE(3,"烟雾防拆报警"),
  SOAK(4,"漏水报警"),
  SOAK_REMOVE(5,"水浸防拆报警"),
  DOOR_LOCK_REMOVE(6,"门锁防拆报警"),
  DOOR_LOCK_PASSWORD_ERROR(7,"门锁密码连续输错5次")
  ;

  private static final ConsoleSkAlarmTypeEnum[] VALUES = ConsoleSkAlarmTypeEnum.values();


  public static String getTypeByCode(Integer code){
    for (ConsoleSkAlarmTypeEnum c : VALUES){
      if (code.equals(c.getCode())){
        return c.type;
      }
    }
    return "";
  }


  private Integer code;
  private String type;

  ConsoleSkAlarmTypeEnum(Integer code, String type) {
    this.code = code;
    this.type = type;
  }

  public Integer getCode() {
    return code;
  }

  public void setCode(Integer code) {
    this.code = code;
  }

  public String getType() {
    return type;
  }

  public void setType(String type) {
    this.type = type;
  }
}
